Array.prototype.inArray = function(value) {
	for (var i = 0; i < this.length; i++) {
		if (this[i] == value) {
			return true;
		}
	}
	
	return false;
};

String.prototype.strip = function(str) {
	var i = 0;
	for (i = 0; i < this.length; i++) {
		if (!(this[i] == str)) {
			break;
		}
	}
	
	return this.substr(i);
};

Date.prototype.toShortString = function() {
	return this.toDateString() + " " + this.getHours() + ":" + this.getMinutes();
};

function createCORSRequest(method, url){
    var xhr = new XMLHttpRequest();
    if ("withCredentials" in xhr){
        xhr.open(method, url, true);
    } else if (typeof XDomainRequest != "undefined"){
        xhr = new XDomainRequest();
        xhr.open(method, url);
    } else {
        xhr = null;
    }
    return xhr;
};